<template>
  <div class="manage-container">
    <!-- 页面标题 -->
    <div class="page-header">
      <h2 class="page-title">
        <i class="el-icon-user-solid"></i>
        咨询师管理
      </h2>
      <p class="page-subtitle">管理平台的心理咨询师信息</p>
    </div>

    <!-- 筛选和操作区域 -->
    <div class="filter-container">
      <div class="section-header">
        <i class="el-icon-search"></i>
        <span>筛选条件</span>
      </div>
      
      <el-form :inline="true" :model="queryParams" class="filter-form">
        <el-row :gutter="20">
          <el-col :span="4">
            <el-form-item label="姓名">
              <el-input
                v-model="queryParams.name"
                placeholder="请输入姓名"
                clearable
                @change="handleQuery"
              ></el-input>
            </el-form-item>
          </el-col>
          
          <el-col :span="4">
            <el-form-item label="职称">
              <el-select
                v-model="queryParams.title"
                placeholder="请选择职称"
                clearable
                @change="handleQuery"
              >
                <el-option label="全部" value=""></el-option>
                <el-option label="主任医师" value="主任医师"></el-option>
                <el-option label="副主任医师" value="副主任医师"></el-option>
                <el-option label="主治医师" value="主治医师"></el-option>
                <el-option label="心理咨询师" value="心理咨询师"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          
          <el-col :span="4">
            <el-form-item label="专业领域">
              <el-select
                v-model="queryParams.specialty"
                placeholder="请选择专业领域"
                clearable
                @change="handleQuery"
              >
                <el-option label="全部" value=""></el-option>
                <el-option label="焦虑抑郁" value="焦虑抑郁"></el-option>
                <el-option label="人际关系" value="人际关系"></el-option>
                <el-option label="情感婚姻" value="情感婚姻"></el-option>
                <el-option label="职业规划" value="职业规划"></el-option>
                <el-option label="青少年心理" value="青少年心理"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          
          <el-col :span="4">
            <el-form-item label="状态">
              <el-select
                v-model="queryParams.status"
                placeholder="请选择状态"
                clearable
                @change="handleQuery"
              >
                <el-option label="全部" value=""></el-option>
                <el-option label="在职" value="active"></el-option>
                <el-option label="休假" value="inactive"></el-option>
                <el-option label="停职" value="suspended"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          
          <el-col :span="4">
            <el-form-item>
              <el-button type="primary" @click="handleQuery">查询</el-button>
              <el-button @click="resetQuery">重置</el-button>
            </el-form-item>
          </el-col>
          
          <el-col :span="4">
            <el-form-item>
              <el-button type="success" @click="handleAdd">
                <i class="el-icon-plus"></i>
                新增咨询师
              </el-button>
              <el-button type="warning" @click="handleBatchDelete" :disabled="selectedRows.length === 0">
                <i class="el-icon-delete"></i>
                批量删除
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>

    <!-- 数据表格 -->
    <div class="table-container">
      <div class="section-header">
        <i class="el-icon-s-grid"></i>
        <span>咨询师列表</span>
        <div class="header-actions">
          <el-button type="text" @click="refreshData">
            <i class="el-icon-refresh"></i>
            刷新
          </el-button>
          <el-button type="text" @click="exportData">
            <i class="el-icon-download"></i>
            导出
          </el-button>
        </div>
      </div>
      
      <el-table
        v-loading="loading"
        :data="filteredConsultants"
        border
        stripe
        height="600"
        @selection-change="handleSelectionChange"
        style="width: 100%"
      >
        <el-table-column type="selection" width="55"></el-table-column>
        
        <el-table-column prop="id" label="编号" width="80" align="center"></el-table-column>
        
        <el-table-column prop="avatar" label="头像" width="80" align="center">
          <template slot-scope="scope">
            <el-avatar :src="scope.row.avatar" size="small">
              <i class="el-icon-user-solid"></i>
            </el-avatar>
          </template>
        </el-table-column>
        
        <el-table-column prop="name" label="姓名" width="100" align="center"></el-table-column>
        
        <el-table-column prop="title" label="职称" width="120" align="center"></el-table-column>
        
        <el-table-column prop="specialty" label="专业领域" width="120" align="center">
          <template slot-scope="scope">
            <el-tag size="small" :type="getSpecialtyTagType(scope.row.specialty)">
              {{ scope.row.specialty }}
            </el-tag>
          </template>
        </el-table-column>
        
        <el-table-column prop="experience" label="工作经验" width="100" align="center">
          <template slot-scope="scope">
            {{ scope.row.experience }}年
          </template>
        </el-table-column>
        
        <el-table-column prop="phone" label="联系电话" width="130" align="center"></el-table-column>
        
        <el-table-column prop="email" label="邮箱" min-width="150" align="center"></el-table-column>
        
        <!-- <el-table-column prop="price" label="咨询费用" width="100" align="center">
          <template slot-scope="scope">
            <span class="price-text">¥{{ scope.row.price }}/小时</span>
          </template>
        </el-table-column> -->
        
        <el-table-column prop="rating" label="评分" width="100" align="center">
          <template slot-scope="scope">
            <el-rate
              :value="scope.row.rating"
              disabled
              :colors="['#f7ba2a', '#f7ba2a', '#f7ba2a']"
              :show-text="false"
            ></el-rate>
          </template>
        </el-table-column>
        
        <el-table-column prop="status" label="状态" width="100" align="center">
          <template slot-scope="scope">
            <el-tag :type="getStatusTagType(scope.row.status)" size="small">
              {{ getStatusText(scope.row.status) }}
            </el-tag>
          </template>
        </el-table-column>
        
        <el-table-column label="操作" width="250" align="center" fixed="right">
          <template slot-scope="scope">
            <el-button type="primary" size="mini" @click="handleView(scope.row)">
              查看
            </el-button>
            <el-button type="warning" size="mini" @click="handleEdit(scope.row)">
              编辑
            </el-button>
            <el-button type="danger" size="mini" @click="handleDelete(scope.row)">
              删除
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      
      <!-- 分页 -->
      <div class="pagination-container">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryParams.pageNum"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="queryParams.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </div>

    <!-- 新增/编辑对话框 -->
    <el-dialog
      :title="formTitle"
      :visible.sync="dialogVisible"
      width="600px"
      :close-on-click-modal="false"
    >
      <el-form
        ref="consultantForm"
        :model="formData"
        :rules="formRules"
        label-width="100px"
      >
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="formData.name" placeholder="请输入姓名"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="职称" prop="title">
              <el-select v-model="formData.title" placeholder="请选择职称" style="width: 100%">
                <el-option label="主任医师" value="主任医师"></el-option>
                <el-option label="副主任医师" value="副主任医师"></el-option>
                <el-option label="主治医师" value="主治医师"></el-option>
                <el-option label="心理咨询师" value="心理咨询师"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="专业领域" prop="specialty">
              <el-select v-model="formData.specialty" placeholder="请选择专业领域" style="width: 100%">
                <el-option label="焦虑抑郁" value="焦虑抑郁"></el-option>
                <el-option label="人际关系" value="人际关系"></el-option>
                <el-option label="情感婚姻" value="情感婚姻"></el-option>
                <el-option label="职业规划" value="职业规划"></el-option>
                <el-option label="青少年心理" value="青少年心理"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作经验" prop="experience">
              <el-input-number
                v-model="formData.experience"
                :min="0"
                :max="50"
                controls-position="right"
                style="width: 100%"
              ></el-input-number>
            </el-form-item>
          </el-col>
        </el-row>
        
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="联系电话" prop="phone">
              <el-input v-model="formData.phone" placeholder="请输入联系电话"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="邮箱" prop="email">
              <el-input v-model="formData.email" placeholder="请输入邮箱"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="咨询费用" prop="price">
              <el-input-number
                v-model="formData.price"
                :min="50"
                :max="1000"
                controls-position="right"
                style="width: 100%"
              ></el-input-number>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态" prop="status">
              <el-select v-model="formData.status" placeholder="请选择状态" style="width: 100%">
                <el-option label="在职" value="active"></el-option>
                <el-option label="休假" value="inactive"></el-option>
                <el-option label="停职" value="suspended"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        
        <el-form-item label="个人简介" prop="description">
          <el-input
            v-model="formData.description"
            type="textarea"
            :rows="3"
            placeholder="请输入个人简介"
          ></el-input>
        </el-form-item>
        
        <el-form-item label="头像URL" prop="avatar">
          <el-input v-model="formData.avatar" placeholder="请输入头像URL"></el-input>
        </el-form-item>
      </el-form>
      
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="handleSubmit">确定</el-button>
      </div>
    </el-dialog>

    <!-- 查看详情对话框 -->
    <el-dialog
      title="咨询师详情"
      :visible.sync="viewDialogVisible"
      width="500px"
    >
      <div v-if="currentConsultant" class="consultant-detail">
        <div class="detail-header">
          <el-avatar :src="currentConsultant.avatar" size="large">
            <i class="el-icon-user-solid"></i>
          </el-avatar>
          <div class="detail-info">
            <h3>{{ currentConsultant.name }}</h3>
            <p>{{ currentConsultant.title }}</p>
          </div>
        </div>
        
        <div class="detail-content">
          <div class="detail-item">
            <span class="label">专业领域：</span>
            <span class="value">{{ currentConsultant.specialty }}</span>
          </div>
          <div class="detail-item">
            <span class="label">工作经验：</span>
            <span class="value">{{ currentConsultant.experience }}年</span>
          </div>
          <div class="detail-item">
            <span class="label">联系电话：</span>
            <span class="value">{{ currentConsultant.phone }}</span>
          </div>
          <div class="detail-item">
            <span class="label">邮箱：</span>
            <span class="value">{{ currentConsultant.email }}</span>
          </div>
          <div class="detail-item">
            <span class="label">咨询费用：</span>
            <span class="value price">¥{{ currentConsultant.price }}/小时</span>
          </div>
          <div class="detail-item">
            <span class="label">评分：</span>
            <span class="value">
              <el-rate
                :value="currentConsultant.rating"
                disabled
                :colors="['#f7ba2a', '#f7ba2a', '#f7ba2a']"
                :show-text="false"
              ></el-rate>
              ({{ currentConsultant.rating }}/5)
            </span>
          </div>
          <div class="detail-item">
            <span class="label">状态：</span>
            <span class="value">
              <el-tag :type="getStatusTagType(currentConsultant.status)" size="small">
                {{ getStatusText(currentConsultant.status) }}
              </el-tag>
            </span>
          </div>
          <div class="detail-item" v-if="currentConsultant.description">
            <span class="label">个人简介：</span>
            <div class="description">{{ currentConsultant.description }}</div>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'ConsultantManage',
  data() {
    return {
      loading: false,
      
      // 查询参数
      queryParams: {
        name: '',
        title: '',
        specialty: '',
        status: '',
        pageNum: 1,
        pageSize: 10
      },
      
      // 咨询师列表
      consultants: [],
      total: 0,
      selectedRows: [],
      
      // 对话框状态
      dialogVisible: false,
      viewDialogVisible: false,
      formTitle: '',
      isEdit: false,
      currentConsultant: null,
      
      // 表单数据
      formData: {
        id: null,
        name: '',
        title: '',
        specialty: '',
        experience: 0,
        phone: '',
        email: '',
        price: 100,
        status: 'active',
        description: '',
        avatar: '',
        rating: 5.0
      },
      
      // 表单验证规则
      formRules: {
        name: [
          { required: true, message: '请输入姓名', trigger: 'blur' },
          { min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
        ],
        title: [
          { required: true, message: '请选择职称', trigger: 'change' }
        ],
        specialty: [
          { required: true, message: '请选择专业领域', trigger: 'change' }
        ],
        experience: [
          { required: true, message: '请输入工作经验', trigger: 'blur' }
        ],
        phone: [
          { required: true, message: '请输入联系电话', trigger: 'blur' },
          { pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }
        ],
        email: [
          { required: true, message: '请输入邮箱', trigger: 'blur' },
          { type: 'email', message: '请输入正确的邮箱格式', trigger: 'blur' }
        ],
        price: [
          { required: true, message: '请输入咨询费用', trigger: 'blur' }
        ],
        status: [
          { required: true, message: '请选择状态', trigger: 'change' }
        ]
      }
    }
  },
  
  computed: {
    // 过滤后的咨询师列表
    filteredConsultants() {
      let filtered = [...this.consultants]
      
      if (this.queryParams.name) {
        filtered = filtered.filter(consultant => 
          consultant.name.includes(this.queryParams.name)
        )
      }
      
      if (this.queryParams.title) {
        filtered = filtered.filter(consultant => 
          consultant.title === this.queryParams.title
        )
      }
      
      if (this.queryParams.specialty) {
        filtered = filtered.filter(consultant => 
          consultant.specialty === this.queryParams.specialty
        )
      }
      
      if (this.queryParams.status) {
        filtered = filtered.filter(consultant => 
          consultant.status === this.queryParams.status
        )
      }
      
      return filtered
    }
  },
  
  async mounted() {
    console.log('咨询师管理页面初始化中...')
    await this.loadData()
    console.log('咨询师管理页面初始化完成！')
  },
  
  methods: {
    // 加载数据
    async loadData() {
      this.loading = true
      try {
        await this.loadConsultants()
      } catch (error) {
        console.error('加载数据失败:', error)
        this.$message.error('加载数据失败，请重试')
      } finally {
        this.loading = false
      }
    },
    
    // 加载咨询师列表
    async loadConsultants() {
      // 模拟API调用延迟
      await new Promise(resolve => setTimeout(resolve, 800))
      
      // 生成模拟数据
      this.consultants = this.generateMockConsultants()
      this.total = this.consultants.length
      
      console.log('加载了', this.consultants.length, '位咨询师信息')
    },
    
    // 生成模拟咨询师数据
    generateMockConsultants() {
      const mockConsultants = []
      const names = ['张心怡', '李明华', '王雅琴', '陈建国', '刘佳娜', '赵文轩', '孙美丽', '周志强', '吴晓敏', '郑雨萱']
      const titles = ['主任医师', '副主任医师', '主治医师', '心理咨询师']
      const specialties = ['焦虑抑郁', '人际关系', '情感婚姻', '职业规划', '青少年心理']
      const statuses = ['active', 'inactive', 'suspended']
      
      for (let i = 1; i <= 15; i++) {
        const name = names[Math.floor(Math.random() * names.length)]
        const title = titles[Math.floor(Math.random() * titles.length)]
        const specialty = specialties[Math.floor(Math.random() * specialties.length)]
        const status = statuses[Math.floor(Math.random() * statuses.length)]
        const experience = 1 + Math.floor(Math.random() * 20)
        const price = 100 + Math.floor(Math.random() * 300)
        const rating = (3.5 + Math.random() * 1.5).toFixed(1)
        
        const descriptions = [
          '拥有丰富的临床经验，擅长认知行为疗法，帮助众多来访者解决心理困扰。',
          '专注于青少年心理健康，在家庭治疗和亲子关系方面有独特的见解。',
          '具备深厚的心理学理论基础，善于运用多种疗法处理复杂心理问题。',
          '温和耐心，善于倾听，在情感咨询和人际关系处理方面经验丰富。',
          '注重整体身心健康，结合传统文化和现代心理学理论进行咨询。'
        ]
        
        mockConsultants.push({
          id: i,
          name: name,
          title: title,
          specialty: specialty,
          experience: experience,
          phone: `1${Math.floor(Math.random() * 9) + 3}${Math.floor(Math.random() * 900000000) + 100000000}`,
          email: `${name.toLowerCase()}@hospital.com`,
          price: price,
          rating: parseFloat(rating),
          status: status,
          avatar: `https://i.pravatar.cc/100?img=${i}`,
          description: descriptions[Math.floor(Math.random() * descriptions.length)],
          createdAt: new Date(Date.now() - Math.random() * 365 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]
        })
      }
      
      return mockConsultants.sort((a, b) => a.id - b.id)
    },
    
    // 获取状态标签类型
    getStatusTagType(status) {
      const typeMap = {
        'active': 'success',
        'inactive': 'warning',
        'suspended': 'danger'
      }
      return typeMap[status] || 'info'
    },
    
    // 获取状态文本
    getStatusText(status) {
      const textMap = {
        'active': '在职',
        'inactive': '休假',
        'suspended': '停职'
      }
      return textMap[status] || '未知'
    },
    
    // 获取专业领域标签类型
    getSpecialtyTagType(specialty) {
      const typeMap = {
        '焦虑抑郁': 'warning',
        '人际关系': 'primary',
        '情感婚姻': 'danger',
        '职业规划': 'success',
        '青少年心理': 'info'
      }
      return typeMap[specialty] || ''
    },
    
    // 查询
    handleQuery() {
      console.log('执行查询:', this.queryParams)
      // 重新计算总数
      this.total = this.filteredConsultants.length
    },
    
    // 重置查询
    resetQuery() {
      this.queryParams = {
        name: '',
        title: '',
        specialty: '',
        status: '',
        pageNum: 1,
        pageSize: 10
      }
      this.handleQuery()
    },
    
    // 刷新数据
    async refreshData() {
      this.$message.info('正在刷新数据...')
      await this.loadData()
      this.$message.success('数据刷新成功')
    },
    
    // 导出数据
    exportData() {
      this.$message.info('导出功能开发中...')
    },
    
    // 表格选择变化
    handleSelectionChange(selection) {
      this.selectedRows = selection
    },
    
    // 分页大小变化
    handleSizeChange(val) {
      this.queryParams.pageSize = val
      this.handleQuery()
    },
    
    // 当前页变化
    handleCurrentChange(val) {
      this.queryParams.pageNum = val
      this.handleQuery()
    },
    
    // 新增咨询师
    handleAdd() {
      this.formTitle = '新增咨询师'
      this.isEdit = false
      this.resetForm()
      this.dialogVisible = true
    },
    
    // 编辑咨询师
    handleEdit(row) {
      this.formTitle = '编辑咨询师'
      this.isEdit = true
      this.formData = { ...row }
      this.dialogVisible = true
    },
    
    // 查看咨询师详情
    handleView(row) {
      this.currentConsultant = row
      this.viewDialogVisible = true
    },
    
    // 删除咨询师
    handleDelete(row) {
      this.$confirm(`确定要删除咨询师 ${row.name} 吗？`, '删除确认', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 模拟删除操作
        const index = this.consultants.findIndex(item => item.id === row.id)
        if (index > -1) {
          this.consultants.splice(index, 1)
          this.total = this.consultants.length
          this.$message.success('删除成功')
        }
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    
    // 批量删除
    handleBatchDelete() {
      const ids = this.selectedRows.map(row => row.id)
      this.$confirm(`确定要删除选中的 ${ids.length} 位咨询师吗？`, '批量删除确认', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 模拟批量删除操作
        this.consultants = this.consultants.filter(item => !ids.includes(item.id))
        this.total = this.consultants.length
        this.selectedRows = []
        this.$message.success(`成功删除 ${ids.length} 位咨询师`)
      }).catch(() => {
        this.$message.info('已取消删除')
      })
    },
    
    // 提交表单
    handleSubmit() {
      this.$refs.consultantForm.validate((valid) => {
        if (valid) {
          if (this.isEdit) {
            // 编辑操作
            const index = this.consultants.findIndex(item => item.id === this.formData.id)
            if (index > -1) {
              this.consultants.splice(index, 1, { ...this.formData })
              this.$message.success('编辑成功')
            }
          } else {
            // 新增操作
            const newId = Math.max(...this.consultants.map(item => item.id)) + 1
            const newConsultant = {
              ...this.formData,
              id: newId,
              rating: 5.0,
              createdAt: new Date().toISOString().split('T')[0]
            }
            this.consultants.unshift(newConsultant)
            this.total = this.consultants.length
            this.$message.success('新增成功')
          }
          this.dialogVisible = false
          this.resetForm()
        } else {
          this.$message.error('请检查表单信息')
        }
      })
    },
    
    // 重置表单
    resetForm() {
      this.formData = {
        id: null,
        name: '',
        title: '',
        specialty: '',
        experience: 0,
        phone: '',
        email: '',
        price: 100,
        status: 'active',
        description: '',
        avatar: '',
        rating: 5.0
      }
      if (this.$refs.consultantForm) {
        this.$refs.consultantForm.resetFields()
      }
    }
  }
}
</script>

<style scoped>
.manage-container {
  padding: 24px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: calc(100vh - 84px);
}

/* 页面头部 */
.page-header {
  margin-bottom: 24px;
  text-align: center;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 8px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title i {
  margin-right: 12px;
  color: #409EFF;
}

.page-subtitle {
  font-size: 16px;
  color: #606266;
  margin: 0;
}

/* 筛选区域 */
.filter-container {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.section-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.section-header i {
  font-size: 18px;
  color: #409EFF;
  margin-right: 8px;
}

.section-header span {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: 0.5px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #409EFF, #67C23A);
  border-radius: 1px;
}

/* 表格容器 */
.table-container {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 24px;
}

/* 表格样式 */
.el-table {
  border-radius: 8px;
  overflow: hidden;
}

.el-table th {
  background: linear-gradient(145deg, #f0f2f5 0%, #e6e8eb 100%);
  color: #2c3e50;
  font-weight: 600;
  text-align: center;
}

.el-table td {
  border-bottom: 1px solid #f0f0f0;
}

.el-table .el-table__row:hover {
  background-color: rgba(64, 158, 255, 0.05);
}

.price-text {
  color: #e6a23c;
  font-weight: 600;
}

/* 分页 */
.pagination-container {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  margin-top: 20px;
}

/* 对话框样式 */
.el-dialog__header {
  background: linear-gradient(145deg, #409EFF 0%, #36a3f7 100%);
  color: white;
  padding: 16px 20px;
  border-radius: 8px 8px 0 0;
}

.el-dialog__title {
  color: white;
  font-weight: 600;
}

.el-dialog__body {
  padding: 24px;
}

.dialog-footer {
  text-align: center;
  padding: 16px;
  border-top: 1px solid #f0f0f0;
}

/* 表单样式 */
.el-form-item__label {
  font-weight: 600;
  color: #2c3e50;
}

.el-input__inner,
.el-select .el-input__inner,
.el-textarea__inner {
  border-radius: 6px;
  border: 1px solid #dcdfe6;
  transition: all 0.3s ease;
}

.el-input__inner:focus,
.el-select .el-input__inner:focus,
.el-textarea__inner:focus {
  border-color: #409EFF;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* 详情对话框 */
.consultant-detail {
  padding: 16px;
}

.detail-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(145deg, #f8fafc 0%, #e6f3ff 100%);
  border-radius: 8px;
  border: 1px solid #d9ecff;
}

.detail-header .el-avatar {
  margin-right: 16px;
}

.detail-info h3 {
  font-size: 18px;
  color: #2c3e50;
  margin: 0 0 4px 0;
  font-weight: 600;
}

.detail-info p {
  font-size: 14px;
  color: #606266;
  margin: 0;
}

.detail-content {
  display: grid;
  gap: 12px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item .label {
  font-size: 14px;
  color: #606266;
  font-weight: 600;
  min-width: 80px;
  margin-right: 12px;
}

.detail-item .value {
  font-size: 14px;
  color: #2c3e50;
  flex: 1;
}

.detail-item .value.price {
  color: #e6a23c;
  font-weight: 600;
}

.description {
  line-height: 1.6;
  text-align: justify;
  margin-top: 4px;
}

/* 按钮样式 */
.el-button {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.el-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.el-button--primary {
  background: linear-gradient(45deg, #409EFF, #36a3f7);
  border-color: #409EFF;
}

.el-button--success {
  background: linear-gradient(45deg, #67c23a, #85ce61);
  border-color: #67c23a;
}

.el-button--warning {
  background: linear-gradient(45deg, #e6a23c, #f7ba2a);
  border-color: #e6a23c;
}

.el-button--danger {
  background: linear-gradient(45deg, #f56c6c, #f78989);
  border-color: #f56c6c;
}

/* 标签样式 */
.el-tag {
  border-radius: 4px;
  font-weight: 500;
}

/* 评分样式 */
.el-rate {
  display: inline-flex;
}

.el-rate__item {
  margin-right: 2px;
}

/* 头像样式 */
.el-avatar {
  border: 2px solid #f0f0f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 加载状态 */
.el-loading-mask {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .manage-container {
    padding: 16px;
  }
  
  .filter-container,
  .table-container {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 24px;
  }
  
  .el-table {
    font-size: 12px;
  }
  
  .el-button {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .detail-header {
    flex-direction: column;
    text-align: center;
  }
  
  .detail-header .el-avatar {
    margin-right: 0;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .manage-container {
    padding: 12px;
  }
  
  .filter-container,
  .table-container {
    padding: 12px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-actions {
    margin-left: 0;
    margin-top: 8px;
  }
  
  .el-dialog {
    width: 95% !important;
    margin: 0 auto;
  }
}

/* 动画效果 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter,
.fade-leave-to {
  opacity: 0;
}

/* 表格行动画 */
.el-table__row {
  transition: all 0.3s ease;
}

/* 卡片阴影效果 */
.filter-container:hover,
.table-container:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}
</style>